<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>templi php 框架: String类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">templi php 框架
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.4 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li class="current"><a href="annotated.html"><span>类</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>类列表</span></a></li>
      <li><a href="classes.html"><span>类索引</span></a></li>
      <li><a href="hierarchy.html"><span>类继承关系</span></a></li>
      <li><a href="functions.html"><span>类成员</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>类</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>函数</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="classString-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">String类 参考</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:a0e527560f115b059be07ce94e839769c"><td class="memItemLeft" align="right" valign="top">static&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classString.html#a0e527560f115b059be07ce94e839769c">password</a> ($password, $encrypt='')</td></tr>
<tr class="separator:a0e527560f115b059be07ce94e839769c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a172acdef033b06452ae33c37ee71fff8"><td class="memItemLeft" align="right" valign="top">static&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classString.html#a172acdef033b06452ae33c37ee71fff8">uuid</a> ()</td></tr>
<tr class="separator:a172acdef033b06452ae33c37ee71fff8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a8509e4c9c51af0559dad799cdbdc7f"><td class="memItemLeft" align="right" valign="top">static&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classString.html#a8a8509e4c9c51af0559dad799cdbdc7f">keyGen</a> ()</td></tr>
<tr class="separator:a8a8509e4c9c51af0559dad799cdbdc7f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a22057e05a0e0c39b5e31a3dafa06f4c3"><td class="memItemLeft" align="right" valign="top">static&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classString.html#a22057e05a0e0c39b5e31a3dafa06f4c3">randString</a> ($len=6, $type='', $addChars='')</td></tr>
<tr class="separator:a22057e05a0e0c39b5e31a3dafa06f4c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ced9f227dd06fa204afcf20438072e8"><td class="memItemLeft" align="right" valign="top">static&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classString.html#a1ced9f227dd06fa204afcf20438072e8">buildCountRand</a> ($number, $length=4, $mode=1)</td></tr>
<tr class="separator:a1ced9f227dd06fa204afcf20438072e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0659d8452d6a2b2b67fab3b3f50965ee"><td class="memItemLeft" align="right" valign="top">static&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classString.html#a0659d8452d6a2b2b67fab3b3f50965ee">buildFormatRand</a> ($format, $number=1)</td></tr>
<tr class="separator:a0659d8452d6a2b2b67fab3b3f50965ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6cdc342eff7d83b45d7fad8da49e1458"><td class="memItemLeft" align="right" valign="top">static&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classString.html#a6cdc342eff7d83b45d7fad8da49e1458">randNumber</a> ($min, $max)</td></tr>
<tr class="separator:a6cdc342eff7d83b45d7fad8da49e1458"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2809b58d7cb457a9925048ba56f08ece"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2809b58d7cb457a9925048ba56f08ece"></a>
static&#160;</td><td class="memItemRight" valign="bottom"><b>autoCharset</b> ($string, $from='gbk', $to='utf-8')</td></tr>
<tr class="separator:a2809b58d7cb457a9925048ba56f08ece"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>string 类 生成随机字符串等 </p>
<dl class="section author"><dt>作者</dt><dd>七觞酒  <a href="#" onclick="location.href='mai'+'lto:'+'739'+'80'+'060'+'0@'+'qq.'+'co'+'m'; return false;">73980<span style="display: none;">.nosp@m.</span>0600<span style="display: none;">.nosp@m.</span>@qq.c<span style="display: none;">.nosp@m.</span>om</a> </dd></dl>
<dl class="section date"><dt>日期</dt><dd>2013-1-20 </dd></dl>
</div><h2 class="groupheader">成员函数说明</h2>
<a class="anchor" id="a1ced9f227dd06fa204afcf20438072e8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static String::buildCountRand </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$number</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$length</em> = <code>4</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$mode</em> = <code>1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>生成一定数量的随机数，并且不重复 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype">integer</td><td class="paramname">$number</td><td>数量 </td></tr>
    <tr><td class="paramtype">int</td><td class="paramname">$length</td><td></td></tr>
    <tr><td class="paramtype">int</td><td class="paramname">$mode</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a0659d8452d6a2b2b67fab3b3f50965ee"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static String::buildFormatRand </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$number</em> = <code>1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>带格式生成随机字符 支持批量生成 但可能存在重复 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype">string</td><td class="paramname">$format</td><td>字符格式 <h1>表示数字 * 表示字母和数字 $ 表示字母</h1>
</td></tr>
    <tr><td class="paramtype">integer</td><td class="paramname">$number</td><td>生成数量 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>string | array </dd></dl>

</div>
</div>
<a class="anchor" id="a8a8509e4c9c51af0559dad799cdbdc7f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static String::keyGen </td>
          <td>(</td>
          <td class="paramname">)</td><td></td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>生成Guid主键 </p>
<dl class="section return"><dt>返回</dt><dd>Boolean </dd></dl>

</div>
</div>
<a class="anchor" id="a0e527560f115b059be07ce94e839769c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static String::password </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$password</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$encrypt</em> = <code>''</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>对用户的密码进行加密 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">$password</td><td></td></tr>
    <tr><td class="paramname">$encrypt</td><td>//传入加密串，在修改密码时做认证 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>array/password </dd></dl>

</div>
</div>
<a class="anchor" id="a6cdc342eff7d83b45d7fad8da49e1458"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static String::randNumber </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$max</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>获取一定范围内的随机数字 位数不足补零 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype">integer</td><td class="paramname">$min</td><td>最小值 </td></tr>
    <tr><td class="paramtype">integer</td><td class="paramname">$max</td><td>最大值 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="a22057e05a0e0c39b5e31a3dafa06f4c3"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static String::randString </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$len</em> = <code>6</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$type</em> = <code>''</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$addChars</em> = <code>''</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>产生随机字串，可用来自动生成密码 默认长度6位 字母和数字混合 支持中文 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramtype">int&#160;|&#160;string</td><td class="paramname">$len</td><td>长度 </td></tr>
    <tr><td class="paramtype">string</td><td class="paramname">$type</td><td>字串类型 0 字母 1 数字 2大写字母 3小写字母 4汉字 其它 混合 </td></tr>
    <tr><td class="paramtype">string</td><td class="paramname">$addChars</td><td>额外字符 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>string </dd></dl>

</div>
</div>
<a class="anchor" id="a172acdef033b06452ae33c37ee71fff8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static String::uuid </td>
          <td>(</td>
          <td class="paramname">)</td><td></td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>生成UUID 单机使用  public </p>
<dl class="section return"><dt>返回</dt><dd>string </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>templi/String.class.php</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2014年 一月 15日 星期三 15:42:02 , 为 templi php 框架使用  &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
</small></address>
</body>
</html>
